package pens.factory
{
	import flash.utils.Dictionary;
	
	import pens.PenType;
	import pens.interfaces.IPenFactory;
	import pens.interfaces.IPenPlayer;
	import pens.penObjects.Pen;
	import pens.penObjects.Pen_Brush;
	import pens.penObjects.Pen_Brush_Mouse;
	import pens.penObjects.Pen_Muise;
	import pens.penObjects.Pen_Sign;
	import pens.penObjects.Pen_Sign_Mouse;

	
	
	/**
	 *此类用于存放画板类，并实现接口 
	 * @author Administrator
	 * 
	 */
	public class PenFactory implements IPenFactory
	{
		
		private var penPlayers:Dictionary=null
		public function PenFactory()
		{
			penPlayers=new Dictionary(true)
			penPlayers[PenType.PEN]=Pen as Class
				
			penPlayers[PenType.PEN_SIGN]=Pen_Sign as Class
			penPlayers[PenType.PEN_SIGN_MOUSE]=Pen_Sign_Mouse as Class
				
			penPlayers[PenType.PEN_BRUSH]=Pen_Brush as Class
			penPlayers[PenType.PEN_BRUSH_MOUSE]=Pen_Brush_Mouse as Class
				
			penPlayers[PenType.PEN_MUISE]=Pen_Muise as Class
				
				
			
		}
		
		/**
		 *  
		 * @param instruct Pen_Parameters里找到
		 * @return 
		 * 
		 */		
		public function createPlayer(instruct:String):IPenPlayer{
			return new penPlayers[instruct]()
		}
		
		
		
		
		
		
		
	}
}